#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Time    : 2021/7/23 11:18
# @Author  : Samge

"""
自定义view 的工具
"""
import os

from itkz.resources.utils import file_util

CUSTOM_VIEW_DIR = '../custom_view/'


def print_custom_view_info():
    """打印 自定义view的路径信息 & 自定义类名"""
    for path in os.listdir(CUSTOM_VIEW_DIR):
        if not str(path).endswith('.py'):
            continue
        os.chdir(CUSTOM_VIEW_DIR)
        view_path = os.path.realpath(path).split('pyqt_policy\\')[1].replace('\\', '.').replace('.py', '')
        class_name = path.replace('.py', '')
        print(f"{class_name} {view_path}")


if __name__ == '__main__':
    print_custom_view_info()
